home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls002.2.Z / tls002.2 / tmp / perms / prep.s3cddx next >
Encoding:
Text File  |  1992-01-13  |  1.4 KB  |  95 lines

  1. :
  2. #
  3. #    prep.s3cddx
  4. #
  5. #    Copyright (C) 1991 Xware.
  6. #
  7.  
  8. PATH=/bin:/usr/bin:/etc:/etc/conf/bin
  9. PERM=/etc/perms/inst            # OS (link kit) permlist
  10.  
  11. : ${OK=0} ${FAIL=1}
  12.  
  13. #
  14. # exit with the status passed as argument
  15. #
  16.  
  17. cleanup() 
  18. {
  19.     trap '' 1 2 3 15
  20.     exit $1
  21. }
  22.  
  23. #
  24. # prompt for yes or no answer with message passed as argument - 
  25. # returns non-zero for no
  26. #
  27.  
  28. getyn() 
  29. {
  30.     while    echo "\n$* (y/n) \c">&2
  31.     do    read yn rest
  32.         case $yn in
  33.         [yY])    return 0                 ;;
  34.         [nN])    return 1                ;;
  35.         *)    echo "Please answer y or n" >&2        ;;
  36.         esac
  37.     done
  38. }
  39.  
  40. #
  41. # test to see if link kit is installed
  42. #
  43.  
  44. chklinkkit() 
  45. {
  46.         echo "Checking Link Kit installation..."
  47.         until    fixperm -i -d LINK $PERM 2> /dev/null
  48.         do    case $? in
  49.         3|4)    echo "The Link Kit is not installed." >&2
  50.             ;;
  51.         5)    echo "The Link Kit is only partially installed." >&2
  52.             echo "Attempting to remove TCP/IP package anyway." >&2
  53.             return 0
  54.             ;;
  55.         *)    echo "Error testing for Link Kit. Exiting."; cleanup 1
  56.             ;;
  57.         esac
  58.  
  59.         #
  60.         # Not fully installed. Do so here
  61.         #
  62.  
  63.         while    echo "Do you wish to install it now? (y/n) \c"
  64.         do    read ANSWER
  65.             case $ANSWER in
  66.             Y|y)    custom -o -i LINK
  67.                 break
  68.                 ;;
  69.             N|n)    echo "Driver cannot be removed without the Link Kit."
  70.                 cleanup 1
  71.                 ;;
  72.             *)    echo "Please answer 'y' or 'n'. \c"
  73.                 ;;
  74.             esac
  75.         done
  76.         done
  77. }
  78.  
  79. #
  80. # main()
  81. #
  82.  
  83. cd /
  84.  
  85. trap 'echo "\nInterrupted! Exiting ..."; cleanup 1' 1 2 3 15
  86.  
  87. #
  88. # check for the linkkit and exit
  89. #
  90.  
  91. chklinkkit
  92.  
  93. cleanup 0
  94.  
  95.